<?php

namespace App\Http\Controllers\Api;

use App\Model\Glory;
use Illuminate\Http\Request;

class GloryController extends BaseController
{
    public function __construct(Request $request, Glory $glory)
    {
        parent::__construct($request);
        $this->model = $glory;
    }
    public function getList(Request $request){
        return $this->toJson(self::SUCCESS,$this->model->getList($request));
    }
    public function upsertGoods(Request $request){
        $res = $this->model->upsertGloryGoods($request->input());
        if ($res){
            return $this->toJson(self::SUCCESS);
        }
        return $this->toJson(self::ERROR);
    }
}
